System.out.println("To start the program, you should input like \'average_grades(new int[][]{{51, 83, 28}, {0, 38, 95}}, new int[]{30, 40, 30})\'")
int[] average_grades(int grades[][], int weights[]) {
    int numStudents = grades.length;
    int[] averages = new int[numStudents];

    for (int i = 0; i < numStudents; i++) {
        int total = 0;
        for (int j = 0; j < grades[i].length; j++) {
            total += grades[i][j] * weights[j];
        }
        averages[i] = total / 100; // Round down to the nearest integer
    }
    
    return averages;
}

